package com.binhu;

import java.math.BigDecimal;
import java.math.RoundingMode;

public class HeTong {

    public static void main(String[] args) {
        //金额
        BigDecimal num = new BigDecimal("1855414");
        //税率
        BigDecimal count = new BigDecimal("13");

        BigDecimal buhanF = num.divide(new BigDecimal("1").add(new BigDecimal("0.01").multiply(count)),2, RoundingMode.HALF_UP);
        BigDecimal buhan = buhanF.setScale(2,RoundingMode.HALF_UP);
        BigDecimal shuijin = num.subtract(buhanF).setScale(2,RoundingMode.HALF_UP);

        System.out.println("不含税");
        System.out.println(buhan);
        System.out.println("税金");
        System.out.println(shuijin);
    }

}
